<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	
	<link href="<%=path %>/css/css.css" type="text/css" media="screen" rel="stylesheet">
	<link href="<%=path %>/css/chosen.css" type="text/css" media="screen" rel="stylesheet">
	
    <script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
    <script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
    <script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
    
    <script language="javascript">
		function ccc()
		{                                                                                         
		     if(document.getElementById("userName").value=="")
			 {
			 	alert("请输入用户名");
				document.getElementById("userName").focus();
				return false;
			 }
			 if(document.getElementById("userPw").value=="")
			 {
			 	alert("请输入密码");
				document.getElementById("userPw").focus();
				return false;
			 }
			 
			 loginService.login(document.getElementById("userName").value,document.getElementById("userPw").value,0,callback);
		}
		
		function callback(data)
		{
		    if(data=="no")
		    {
		        alert("用户名或密码错误");
		    }
		    if(data=="yes")
		    {
		        alert("通过验证,系统登录成功");
		        window.location.href="<%=path %>/admin/index.jsp";
		    }
		    
		}
		
		function qing()
		{
		    document.ThisForm.userName.value="";
		    document.ThisForm.userPw.value="";
		}
	</script>
	
	<link href="favicon.ico" rel="SHORTCUT ICON">
	<title>农产品交易后台</title>
  </head>
  
<body id="login">

</head>
<body>
<div class="head">
  <div class="wrap clearfix">
    <a href="#" class="logo indent">logo</a>
    <div class="headr fr">
     </div>
  </div>
</div>
<div class="loginwrapper">
  <div class="wrap pr">
    <div class="loginbox">
      <h1 class="hd">达芬奇农场交易后台管理</h1>
      <div class="tc">
      </div>
      <div class="Prompt"></div>
      
      <div class="boxbd">
        <div class="ohter"><span class="ohtertxt"></span></div>
        <label class="label">
          <input class="loginipt user" type="text" id="userName" name="userName" placeholder="请输入您的用户名"/>
        </label>
        <label class="label">
          <input class="loginipt pwd" type="password" id="userPw" name="userPw" placeholder="请输入您的密码"/>
        </label>
        <button type="submit" name="login" value="" class="button btn-login" onClick="ccc()">登录</button>
      </div>
      
    </div>    
  </div>
</div>
<div class="foot2">
  <div class="wrap clearfix">
    <div class="txt fl">
     <div class="foot-nav"></div>
     Copyright 2019-10-27 All Rights Reserved　
    </div>
    <div class="orc fr"><img src="images/img2.jpg" width="63"><img src="images/img3.jpg" width="63"></div>
  </div>
</div>
<script src="<%=path %>/js/jquery.js"></script>
<script src="<%=path %>/js/Action.js"></script>
</body>
</html>
